Using Named Colors in Internet Explorer

November 22, 1996

Robert B. Hess
Software Design Engineer, Microsoft Developer Relations Group

You can specify a color in your HTML code in two ways: by indicating its RGB (red-green-blue) value:

<td bgcolor="#FF99CC">

or by specifying a color name:

<font color="maroon">

As you can see, the second method is far easier to understand and remember.

When you use a color name, you essentially have two sets of colors to work with: the VGA color set and the X11 color names. The VGA color set consists of 16 colors that can always be properly rendered, regardless of the color resolution of the user's display card. These colors are:

The 16 VGA Colors
Black Silver Gray White
Maroon Red Purple Fuchsia
Green Lime Olive Yellow
Navy Blue Teal Aqua

(Note: Netscape Navigator users will need version 3.0 or later to view the full table.)

Although these color names are easier to remember than their hexadecimal RGB values, you will quickly find that this set offers rather limited flexibility for color selection.

What you really need is a more robust method for specifying a color. Wouldn't you like to be able to say:

<body bgcolor="a light navy blue with a touch of green">
Well, so would I, but I can't. However, you can specify more than 16 colors by name by using the X11 color names.

Originally, the Cascading Style Sheet (CSS) specification from the World Wide Web Consortium (W3C) included a table of "named" colors recommended as part of a standard CSS implementation. The color names they used came from the old X11 implementation, which provides a slightly strange mix of colors and names that has since been adopted by a large number of applications and platforms.

There was a lot of debate and concern regarding the inclusion of these colors in the CSS specification. W3C finally decided not to include them in the final specification, but instead decided to investigate a separate proposal for creating a robust and flexible named color space.

However, these X11 color names do happen to be currently supported by the latest versions of browsers from both Microsoft and Netscape, so I thought it would be useful to provide a visual list for your use.

See below for a listing of the X11 colors supported by Microsoft® Internet Explorer and Netscape Navigator. Click one of the color names to see how that color will be rendered on a Web page.



AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornFlowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenrod, DarkGray, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, Goldenrod, Gray, Green, GreenYellow, Honeydew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenrodYellow, LightGreen, LightGrey, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquamarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenrod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, Seashell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen

I've also created a set of tables with color names, hexadecimal RGB values, decimal values, and a color swatch of each color. I've used a simpler table layout that takes advantage of the BGCOLOR attribute of table cells to display the color samples. These tables present the colors sorted by:

© 1997 Microsoft Corporation. All rights reserved. Legal Notices.